﻿#include<fstream>
#include<iostream>

using namespace std;

int main() {
	ifstream inputFile("stageData.txt", ifstream::binary);
	inputFile.seekg(0, ifstream::end);

	int fileSize = static_cast<int>(inputFile.tellg());

	inputFile.seekg(0, ifstream::beg);

	char bom[3];
	inputFile.read(bom, 3);
	if (bom[0] != char(0xEF) || bom[1] != char(0xBB) || bom[2] != char(0xBF)) {
		inputFile.seekg(0);
	}
	else {
		fileSize -= 3;
	}

	char* fileImage = new char[fileSize];
	inputFile.read(fileImage, fileSize);

	cout.write(fileImage, fileSize);

	cin.get();
}